package com.bawei.homegroup.seckill.viewmodel;


import androidx.databinding.ObservableField;

import com.bawei.homegroup.seckill.data.entity.SecKillEntity;
import com.bawei.homegroup.seckill.model.SecKillModel;
import com.bawei.mvvmcomm.field.UIField;
import com.bawei.mvvmcomm.mvvm.viewmodel.BaseViewModel;
import com.bawei.networkmoudle.Entity.BaseEntity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SecKillValueViewModel extends BaseViewModel<SecKillModel> {

    public SecKillEntity.Value value;
    public ObservableField<List<String>> bannerimgs = new ObservableField<>();

    @Override
    protected void initData() {
        List<String>banners = new ArrayList<>();
        banners.add(value.goods_default_icon);
        bannerimgs.set(banners);
    }

    @Override
    protected SecKillModel createModel() {
        return new SecKillModel();
    }

    public void finishActivity(){
        getUiChangeLiveData().getFinishActivity().setValue(""+System.currentTimeMillis());
    }

    public void share(){

    }

    public void carList(){

        Map<String,Object> pageMap = new HashMap<>();
        pageMap.put(UIField.ACTIONTYPE,UIField.AROUTERSTART);
        pageMap.put(UIField.ACTIONROUTERKEY,"/cargroup/carlistactivity");
        getUiChangeLiveData().getStartActivity().setValue(pageMap);
    }

    public void addCar(){

    }

    @Override
    protected void sucessFull(BaseEntity entity) {

    }

}